home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
abrows1a
/
frmbrows.frm
< prev
next >
Wrap
Text File
|
1999-07-24
|
9KB
|
302 lines
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "SHDOCVW.DLL"
Begin VB.Form frmBrowser
Caption = "Andrew's Web Browser"
ClientHeight = 6135
ClientLeft = 3060
ClientTop = 3630
ClientWidth = 7275
LinkTopic = "Form1"
Picture = "frmBrowser.frx":0000
ScaleHeight = 6135
ScaleWidth = 7275
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.Timer timTimer
Enabled = 0 'False
Interval = 5
Left = 6180
Top = 1500
End
Begin VB.PictureBox picAddress
Align = 1 'Align Top
BorderStyle = 0 'None
Height = 675
Left = 0
ScaleHeight = 675
ScaleWidth = 7275
TabIndex = 3
TabStop = 0 'False
Top = 540
Width = 7275
Begin VB.ComboBox cboAddress
Height = 315
Left = 45
TabIndex = 2
Text = "Type your URL here"
Top = 300
Width = 3795
End
Begin VB.Label lblAddress
Caption = "&URL:"
Height = 255
Left = 45
TabIndex = 1
Tag = "&Address:"
Top = 60
Width = 3075
End
End
Begin MSComctlLib.ImageList imlToolbarIcons
Left = 2670
Top = 2325
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 24
ImageHeight = 24
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 6
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmBrowser.frx":3FB2
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmBrowser.frx":46C4
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmBrowser.frx":4DD6
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmBrowser.frx":54E8
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmBrowser.frx":5BFA
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmBrowser.frx":630C
Key = ""
EndProperty
EndProperty
End
Begin SHDocVwCtl.WebBrowser brwWebBrowser
Height = 3600
Left = 0
TabIndex = 0
Top = 1440
Width = 5640
ExtentX = 9948
ExtentY = 6350
ViewMode = 1
Offline = 0
Silent = 0
RegisterAsBrowser= 0
RegisterAsDropTarget= 1
AutoArrange = -1 'True
NoClientEdge = 0 'False
AlignLeft = 0 'False
ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
Location = ""
End
Begin MSComctlLib.Toolbar tbToolBar
Align = 1 'Align Top
Height = 540
Left = 0
TabIndex = 4
Top = 0
Width = 7275
_ExtentX = 12832
_ExtentY = 953
ButtonWidth = 1191
ButtonHeight = 953
Style = 1
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 6
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "Back"
Key = "Back"
Object.ToolTipText = "Back"
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "Forward"
Key = "Forward"
Object.ToolTipText = "Forward"
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "Stop"
Key = "Stop"
Object.ToolTipText = "Stop"
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "Refresh"
Key = "Refresh"
Object.ToolTipText = "Refresh"
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "Home"
Key = "Home"
Object.ToolTipText = "Home"
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "Close"
Key = "Close"
Object.ToolTipText = "Close"
EndProperty
EndProperty
MousePointer = 10
OLEDropMode = 1
End
Begin VB.Menu File
Caption = "&File"
Begin VB.Menu menu
Caption = "-"
Index = 1
End
Begin VB.Menu Exit
Caption = "&Exit"
End
End
Begin VB.Menu Help
Caption = "&Help"
Begin VB.Menu About
Caption = "&About"
End
End
End
Attribute VB_Name = "frmBrowser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public StartingAddress As String
Dim mbDontNavigateNow As Boolean
Private Sub about_Click()
frmAbout.Show vbModal, Me
End Sub
Private Sub exit_Click()
Unload Me
End Sub
Private Sub Form_Load()
On Error Resume Next
Me.Show
tbToolBar.Refresh
Form_Resize
cboAddress.Move 50, lblAddress.Top + lblAddress.Height + 15
If Len(StartingAddress) > 0 Then
cboAddress.Text = StartingAddress
cboAddress.AddItem cboAddress.Text
timTimer.Enabled = True
brwWebBrowser.Navigate StartingAddress
End If
End Sub
Private Sub brwWebBrowser_DownloadComplete()
On Error Resume Next
Me.Caption = brwWebBrowser.LocationName
End Sub
Private Sub brwWebBrowser_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
On Error Resume Next
Dim i As Integer
Dim bFound As Boolean
Me.Caption = brwWebBrowser.LocationName
For i = 0 To cboAddress.ListCount - 1
If cboAddress.List(i) = brwWebBrowser.LocationURL Then
bFound = True
Exit For
End If
Next i
mbDontNavigateNow = True
If bFound Then
cboAddress.RemoveItem i
End If
cboAddress.AddItem brwWebBrowser.LocationURL, 0
cboAddress.ListIndex = 0
mbDontNavigateNow = False
End Sub
Private Sub cboAddress_Click()
If mbDontNavigateNow Then Exit Sub
timTimer.Enabled = True
brwWebBrowser.Navigate cboAddress.Text
End Sub
Private Sub cboAddress_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = vbKeyReturn Then
cboAddress_Click
End If
End Sub
Private Sub Form_Resize()
On Error Resume Next
cboAddress.Width = Me.ScaleWidth - 100
b